@layout('admin::layouts.admin')

@section('login')

@if (!is_null(Session::get('error')) )
<div class="row-fluid" >
    <div class="span9">
        <div class="alert alert-error span8 pull-right" style="position:relative;margin-right: auto;margin-left: auto">
            <a class="close" data-dismiss="alert" href="#">×</a>
            <h4 class="alert-heading">Harap Maaf...</h4>
            @if(Session::get('error'))
                <span class="text-error">Maaf, E-mel atau Kata Laluan anda tidak betul.</span>
            @endif
        </div>
    </div>
</div>
<div class="row-fluid" >
    &nbsp;
</div>
@endif

<center>
{{Form::open('admin/login', 'POST', array('class'=>'form-actions','id'=>'logns','data-ajax'=>'false','style'=>'border:1px solid #E5E5E5;margin:0px auto;padding:19px 29px 29px;max-width:300px;box-shadow:0 1px 2px rgba(0, 0, 0, 0.05)'))}}
<h3>System Admin Login</h3>
{{ Form::span12_text('username',null,array('placeholder'=>'Username','required')) }}
{{ Form::span12_password('password',array('placeholder'=>'Password','required')) }}
{{	Form::token()}}
{{	Button::inverse_normal('Request Credentials', array('id' => 'credential'))->with_icon('certificate icon-white')}}
&nbsp;
{{	Form::submit('Login', array('class' => 'btn btn-primary'))}}

{{	Form::close()}}
</center>
@endsection

@section('scripts')
<script>

	$('#credential').click(function() {
        $('body').modalmanager('loading');
		$.post('login/credentials', $("#logns").serialize(),function(data) {
			      sourcedata = data;
			    }).success(function() { 
                    $('body').modalmanager('loading');
			    }); 

	});

</script>
@endsection
